//
//  DLWebView.m
//  AllPass
//
//  Created by apple on 2021/12/30.
//

#import "DLWebView.h"
#import <WebKit/WebKit.h>
@interface DLWebView ()
@property(nonatomic, strong) WKWebView *web;
@end

@implementation DLWebView

- (void)viewDidLoad {
    [super viewDidLoad];
    WKWebViewConfiguration *config = [WKWebViewConfiguration new];
    self.web = [[WKWebView alloc]initWithFrame:CGRectZero configuration:config];
    self.web.backgroundColor = UIColorWhite;
    self.web.frame = Frame(0, kTopHeight, SCREEN_WIDTH, SCREEN_HEIGHT - kTopHeight);
    [self.view addSubview:self.web];
    
    NSBundle* bundle = [NSBundle mainBundle];
    NSString *filePath = [bundle pathForResource:@"use" ofType:@"html"];
    NSData *htmlData = [NSData dataWithContentsOfFile:filePath];
    NSString *htmlString = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding];
    [self.web loadHTMLString:htmlString baseURL:nil];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
